package com.cxd.springcloud.controller;

import com.cxd.springcloud.feign.PaymentFeign;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderController {

    @Resource
    private PaymentFeign paymentFeign;

    @GetMapping("/consumer/hystrix/sayHello/{id}")
    public String sayHello_Ok(@PathVariable("id")Integer id) {
        return paymentFeign.sayHello(id);
    }

    @GetMapping("/consumer/hystrix/sayHello/timeOut/{id}")
    public String sayHelloTimeOut(@PathVariable("id") Integer id) {
        return paymentFeign.sayHelloTimeOut(id);
    }
}
